home *** CD-ROM | disk | FTP | other *** search
/ Hyper Stacks 1994 May / Hyper Stacks (Pacific HiTech)(1994)[Mac].iso / Utilities / Import⁄Export Tools / Import_Export Tools / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1994-04-05  |  6.7 KB  |  25 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>5</cardCount>
  7.     <cardID>4384</cardID>
  8.     <listID>4637</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>448</width>
  14.         <height>296</height>
  15.     </cardSize>
  16.     <script>------------------RTF Capability-----------------
  17.  
  18. on TestRTF
  19. global RTFSTAT
  20. put resList() into r
  21. if r contains "FieldtoRTF" and r contains "RTFtoField" then
  22. put true into RTFSTAT
  23. else put false into RTFSTAT
  24. end TEstRTF
  25.  
  26. function RTFisHere
  27. global RTFSTAT
  28. return RTFSTAT
  29. end RTFisHere
  30.  
  31. -------------------------------------------------
  32.  
  33. on openStack
  34. -- Requires handlers: createTheMenu,wrongStack
  35. if wrongStack() then pass openStack -- in case stackInUse
  36. if the version < 2.0 then
  37. put "This stack is for Hypercard 2.0. If you do not have it installed, you " into temp
  38. put "will not be able to run some of the functions." after temp
  39. answer temp
  40. end if
  41. lock screen
  42. testRTF
  43. createthemenu
  44. pass openStack
  45. end openStack
  46.  
  47. on closeStack
  48. -- Requires handlers: deleteStackMenu,wrongStack
  49. if wrongStack() then pass closeStack -- in case stackInUse
  50. put empty into StackMenu -- clean-up for exit
  51. lock screen
  52. deleteStackMenu
  53. if (the visible of cd fld "About 1" of card 1) then
  54. send mouseUp to cd button id 5 of cd 1
  55. end if
  56. pass closeStack
  57. end closeStack
  58.  
  59. on resumeStack
  60. -- Requires handlers: createTheMenu,wrongStack
  61. -- Requires handlers: setLocationCheckMark,changeMenuItemStatus
  62. if wrongStack() then pass resumeStack -- in case stackInUse
  63. createTheMenu
  64. setLocationCheckMark(short name of this card)
  65. pass resumeStack
  66. show menubar
  67. end resumeStack
  68.  
  69. on suspendStack
  70. -- Requires handler: deleteStackMenu,wrongStack
  71. if wrongStack() then pass suspendStack -- in case stackInUse
  72. deleteStackMenu
  73. pass suspendStack
  74. end suspendStack
  75.  
  76. function wrongStack
  77. return (line 1 of the stacks is not in long name of me)
  78. end wrongStack
  79.  
  80. -------------------Menu Items-------------------------------
  81.  
  82. on createTheMenu
  83. -- Requires function handlers: menuItemData,menuMsgData
  84. global StackMenu
  85. put "Go To" into StackMenu -- ‚àÜ
  86. -- remove any existing menus that might have the same name
  87. if there is a menu StackMenu then delete menu StackMenu
  88. create menu StackMenu
  89. put menuItemData() into menu StackMenu
  90. end createTheMenu
  91.  
  92. function menuItemData
  93. -- Requires function handlers:navMenuItemData
  94. global backpop
  95. return navmenuitemdata()
  96. end menuItemData
  97.  
  98. function navmenuitemdata
  99. return "Import Text,Export Text,Stack -> Stack,-,Parameters"
  100. end navmenuitemdata
  101.  
  102. on deleteStackMenu
  103. global StackMenu
  104. if StackMenu is in the menus then delete menu StackMenu
  105. end deleteStackMenu
  106.  
  107. on unCheckItems theItems
  108. global StackMenu
  109. if there is no menu StackMenu then exit unCheckItems
  110. get navMenuItemData()
  111. repeat with count = 1 to number of items in it
  112. set checkMark of menuItem item count of it of menu StackMenu to false
  113. end repeat
  114. end unCheckItems
  115.  
  116. on setLocationCheckMark locationMenu
  117. -- Requires handler: unCheckItems
  118. -- set check mark for current user location
  119. global StackMenu
  120. unCheckItems "Nav"
  121. if locationmenu is not in NavMenuItemData() then exit setlocationcheckmark
  122. set the checkMark of menuItem locationMenu of menu StackMenu to true
  123. end setLocationCheckMark
  124.  
  125. -----  Navigational Scripts  --------------------
  126.  
  127. on domenu temp
  128. global backpop
  129. if temp is "Import Text" then
  130. global filename
  131. lock screen
  132. set cursor to busy
  133. go to cd "import text"
  134. set name of cd button id 38 to "Select Stack"
  135. if visible of cd field "hidden" is true then
  136. set the visible of cd field "hidden" to false
  137. end if
  138. send "disableItems" to cd
  139. if checkfile(filename) then close file filename
  140. setlocationcheckmark(temp)
  141. put empty into message box
  142. exit domenu
  143. end if
  144.  
  145. if temp is "Export Text" then
  146. lock screen
  147. set cursor to busy
  148. global cardid
  149. go to cd "Export Text"
  150. put name of this card into cardid
  151. send "DisableItems" to cd
  152. if checkfile(filename) then close file filename
  153. setlocationcheckmark(temp)
  154. if visible of cd field "hidden" is true then
  155. set the visible of cd field "hidden" to false
  156. end if
  157. put empty into message box
  158. exit domenu
  159. end if
  160.  
  161. if temp is "Stack -> Stack" then
  162. lock screen
  163. set cursor to busy
  164. global cardid
  165. put name of this card into cardid
  166. go to cd "Stack -> Stack"
  167. send "disableitems ("&quote&"i"&quote&")" to cd
  168. send "disableitems ("&quote&"j"&quote&")" to cd
  169. send "testenable" to cd
  170. if visible of cd field "hidden" is true then
  171. set visible of cd field "hidden" to false
  172. end if
  173. if checkfile(filename) then close file filename
  174. setlocationcheckmark(temp)
  175. put empty into message box
  176. exit domenu
  177. end if
  178.  
  179. if temp is "Parameters" then
  180. global cardid
  181. put name of this card into cardid
  182. go card "parameters"
  183. setlocationcheckmark(temp)
  184. put empty into message box
  185. exit domenu
  186. end if
  187.  
  188. pass domenu
  189. end domenu
  190.  
  191. function Disableitems1 param1,param2,param3,param4
  192. do "set name of cd button id "&param2&" to "&quote&"Open Stack"&quote
  193. do "put empty into cd fld id "&param3
  194. do "put empty into cd fld id "&param4
  195. do "set the textfont of cd fld "&quote¬¨
  196. &param1&"background to use"&quote&" to chicago gray"
  197. return true
  198. end DisableItems1
  199.  
  200. on dolock param
  201. set lockscreen to param
  202. set lockmessages to param
  203. set lockrecent to param
  204. end dolock
  205.  
  206. function volumenamed filename
  207. get offset (":",filename)
  208. put char 1 to it of filename into volname
  209. return volname
  210. end volumenamed
  211.  
  212. function Checkfile filename
  213. global errGlobal
  214. if filename is empty then
  215. return false
  216. exit checkfile
  217. else
  218. put volumenamed(filename) into newVolume
  219. if newVolume = empty then
  220. return false
  221. exit checkfile
  222. else
  223. put OpenFiles(newVolume, "noDialog:errGlobal") into fileList
  224. if errGlobal ‚↠empty then
  225. answer "Error:" && errGlobal
  226. put empty into errGlobal
  227. return false
  228. exit checkfile
  229. end if
  230. repeat with rr = 1 to number of lines of filelist
  231. if line rr of filelist is filename then
  232. return true
  233. exit checkfile
  234. end if
  235. end repeat
  236. end if
  237. return false
  238. end if
  239. end checkfile
  240.  
  241.  
  242. function leafname filein
  243. put (length(filein)) into temp
  244. repeat with rr =  temp down to 1
  245. if char rr of filein is ":" then exit repeat
  246. end repeat
  247. return char (rr+1) to temp of filein
  248. end leafname
  249.  
  250. </script>
  251.     <background id="2959" file="background_2959.xml" name="Front Background" />
  252.     <background id="17972" file="background_17972.xml" name="Export-Import" />
  253.     <card id="4384" file="card_4384.xml" marked="false" name="First" owner="2959" />
  254.     <card id="18384" file="card_18384.xml" marked="false" name="Import Text" owner="17972" />
  255.     <card id="8359" file="card_8359.xml" marked="false" name="Export TExt" owner="17972" />
  256.     <card id="2103" file="card_2103.xml" marked="false" name="Stack -> Stack" owner="17972" />
  257.     <card id="7075" file="card_7075.xml" marked="false" name="Parameters" owner="17972" />
  258. </stack>
  259.